<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
  <meta charset="UTF-8">
  <meta content="yes" name="apple-mobile-web-app-capable">
  <meta content="yes" name="apple-touch-fullscreen">
  <meta name="App-Config" content="fullscreen=yes,useHistoryState=yes,transition=yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0;">
  <meta name="threme-color" content="#fff">
  <title>xxx</title>
		<style>
      *{margin: 0;padding: 0;}
      .page{
        font-size: 18rem;
      }
      .box{
        width: 25rem;
        height: 37rem;
        float: left;
        overflow: hidden;
        text-align: center;
        font-size: 1rem;
      }
      .itrem{
        display: flex;
        margin:1.5rem;
      }
      .itremName{
        width: 4rem;
      }
      .borderBottom{
        flex: 1;
        height: 1.5rem;
        border-bottom: 0.08rem solid #000;
      }
      .qrcode{
        width: 20rem;
        height: 20rem;
        margin: 1rem auto;
      }
      .jlp{
        text-align: right;
        margin-right: 2rem;
      }
    </style>
</head>
<body>
  <div class="page">
    <div class="box">
      <img class="qrcode" src="/v2/facility/WeChatMiniAppQrCode?{1}" />
      <div class="itrem">
        <span class="itremName">设施类型</span>
        <div class="borderBottom"></div>
      </div>
      <div class="itrem">
        <span class="itremName">设施名称</span>
        <div class="borderBottom"></div>
      </div>
      <div class="itrem">
        <span class="itremName">  </span>
        <div class="borderBottom"></div>
      </div>
      <div class="jlp">九龙坡区环境卫生管理处制</div>
    </div>
  </div>
</body>
</html>
<script>
  function getParam(name) {
    var r = window.location.href.split('?');
    if(!r[1]) return null;
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    r = r[1].match(reg);
    if (r != null) return decodeURIComponent(r[2]);
    return null;
  }
  document.documentElement.style.fontSize = '8px'
  let box = document.querySelector('.box').outerHTML
  let num = getParam('num') || 9

  let html = []
  for(let i = 0; i < num; i ++) {
    html.push(box.replace('{1}',i))
  }
  document.querySelector('.page').innerHTML = html.join('')
  window.print()
</script>